<script>
import { open } from '@/utils/JumpUtils.js'
export default {
  methods: {
    setData() {
      this.tradeNo = this.data.TRADE_NO
      this.title = this.data.TITLE
      this.datetime = this.formatData(this.data.TRADE_TIME)
      this.price = parseFloat(this.data.TX_AMOUNT).toFixed(2)
      this.tradeType = this.data.TRADE_SCENE
      this.state = this.data.TRADE_STATUS
      switch (this.state) {
        // 除了失败和取消以外的状态图标都展示蓝色
        case 0: // 待支付
          this.iconStyle = 'baseBgColorNoActive'
          this.descStyle = 'fontsize28 baseColorNoAcitve'
          break
        case 1: // 成功：消费-渠道成功；充值-渠道成功，充值成功
          this.iconStyle = 'baseBgColorNoActive'
          this.descStyle = 'fontsize34'
          break
        case 2: // 失败：渠道失败
          this.iconStyle = 'consume-fail-icon'
          this.descStyle = 'fontsize28 consume-color-999'
          break
        case 3: // 处理中：渠道处理中
          this.iconStyle = 'baseBgColorNoActive'
          this.descStyle = 'fontsize28 consume-color-999'
          break
        case 4: // 渠道成功，充值处理中
          this.iconStyle = 'baseBgColorNoActive'
          this.descStyle = 'fontsize28 consume-color-999'
          break
        case 5: // 渠道成功，充值失败
          this.iconStyle = 'consume-fail-icon'
          this.descStyle = 'fontsize28 consume-color-999'
          break
        case 9: // 取消
          this.iconStyle = 'consume-fail-icon'
          this.descStyle = 'fontsize28 consume-color-999'
          break
      }
      this.setStateDesc()
    },
    goToDetail() {
      open('routebill.html?tradeno=' + this.tradeNo + '&tradetype=' + this.tradeType)
    },
    setStateDesc() {

    }
  }
}
</script>
